#!/usr/bin/env node

import { program } from "commander";
import { createProjectAction, addComponentAction } from "./core/actions.js";
import { commandOptions } from "./core/options.js";

// 1.配置所有的options
commandOptions();

// 2.增加具体的一些功能操作
program
    .command("create <project> [...others]")
    .description("create vue project into a folder, eg: kun create airbnb")
    .action(createProjectAction);

program
    .command("addcpn <cpnname> [...others]")
    .description("add vue component into a folder, eg: kun addcpn NavBar -d src/components")
    .action(addComponentAction);

// 让commander解析process.argv参数
program.parse(process.argv);
